from django.db import models
from datetime import datetime


class Banner(models.Model):

    """
    首页轮播
    """
    title = models.CharField(max_length=50,verbose_name="标题")
    img = models.CharField(max_length=100,null=True,verbose_name="图片链接")
    url = models.CharField(max_length=100,null=True,verbose_name="链接地址")
    author = models.CharField(max_length=20,null=True,verbose_name="作者")

    class Meta:
        verbose_name = "首页轮播图"
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.title

class AppTabSetting(models.Model):

    """
    主题设置
    """
    tagID = models.IntegerField(verbose_name="主题ID",default=0)
    title = models.CharField(max_length=11,verbose_name="主题标题")
    norbgImage = models.FileField(upload_to='App/Tab',verbose_name="默认图片")
    selectbgImage = models.FileField(upload_to='App/Tab',verbose_name="选中图片")

    class Meta:
        verbose_name = "主题设置"
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.title


class AppSetting(models.Model):

    """
    app设置
    """
    launchImage = models.FileField(upload_to='App/LaunchImage', verbose_name="启动页")
    navColor = models.CharField(max_length=11,verbose_name="导航颜色")
    tabColor = models.CharField(max_length=11,verbose_name="工具栏颜色")
    tabnorColor = models.CharField(max_length=11, verbose_name="工具栏字体颜色")
    tabselectColor = models.CharField(max_length=11, verbose_name="工具栏字体选中颜色")
    is_Tab = models.BooleanField(default=0,verbose_name="是否开启主题设置")
    is_NewFrame = models.BooleanField(default=0,verbose_name="是否开启新特性")

    class Meta:
        verbose_name = "应用设置"
        verbose_name_plural = verbose_name

    def __str__(self):
        return "应用设置"